<?php

Yii::import('zii.widgets.CPortlet');

class SuppliersWidget extends CPortlet {

    public function init() {
        $this->title = Shop::t('Danh sách nhà cung cấp');
        return parent::init();
    }

    public function run() {
        $suppliers = new CActiveDataProvider('User', array(
                    'criteria' => array(
                        'condition' => 'superuser = ' . User::S_SUPPLIER . ' AND status = ' . User::STATUS_ACTIVE,
                        'order'=>'rand()'
                
                    )
                ));
        $suppliers->pagination->pageSize = 16;
        $this->render('application.modules.shop.views.shop.supplier', array(
            'suppliers' => $suppliers
                )
        );
        return parent::run();
    }

}

?>
